
<?php  if (getParameter("mode")!="edit") { ?>
<div id="cse" style="width: 100%;">Loading</div>
<script src="//www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript"> 
  google.load('search', '1', {language : '<?php echo $lang; ?>'});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('002106797992012086950:ajjjmwqfccw');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse');
  }, true);

	var keywords="<?php echo getParameter("keywords"); ?>";

  searchdone=false;

  setupsearch=function(){

 //alert(timer);
  if (!searchdone && $('input[name="search"]').length==1 && keywords!=""){
      searchdone=true
  $('input[name="search"]').val(keywords);

      <?php if ($LANG=="AR") { ?> $('input[name="search"]').attr("dir","rtl"); <?php } ?>
  $('input[class="gsc-search-button"]').click();


  $('div[class="gsc-adBlock"]').hide();
  $.every("1sec", function ()
  {
  $('div[class="gsc-adBlock"]').hide();
  		
  });


  }
      clearInterval(timer);
  }
  var timer=setInterval(setupsearch, 1000);

</script>
<link rel="stylesheet" href="//www.google.com/cse/style/look/default.css" type="text/css" />
<?php


    if ($LANG=="AR")
        Yamlify("gsc-i-id1");



} ?>